<?php 
use yii\helpers\Url;
use app\models\Cart;
?>
<div class="g-header">
    <div class="wrapper">
        <div class="g-logo">
            <a class="logo" href="/" title="找化妆品网"></a>
        </div>
        <div class="g-search">
            <div class="search-wp clearfix">
                <form action="<?php echo Url::toRoute(['listpage/index']) ?>" method="get">
                    <div class="so-type">
                        <i></i>
                        <span>所有分类</span>
                        <ul class="hide">
                        	<?php  foreach($cate1 as $value){?>
                            	<li><a href="javascript:;" onclick="document.getElementById('basetype_id').value=<?=$value['id']?>;"><?=$value['name']?></a></li>
                            <?php }?>
                        	<input type="hidden" id='basetype_id' name='basetype_id' value=''>
                            <!--<li><a href="javascript:;">彩妆</a></li>
                            <li><a href="javascript:;">香水</a></li>-->
                        </ul>
                    </div>
                    <div class="so-input">
                        <input class="so-keyword" id="searchKeywords" name="keyword" type="text" autocomplete="off" />
                        <input class="so-submit" type="submit" value="搜索"/>
                        <div class="so-reclist hide" id="searchRecList">
<!--                            <ul>
                                <li><a href="#">雅诗兰黛</a></li>
                                <li><a href="#">雅诗兰黛沐浴露</a></li>
                            </ul>
                            <p><a class="close" href="javascript:;">关闭</a></p>-->
                        </div>
                    </div>
                </form>
            </div>
            <div class="hot-keyword">
            	<?php foreach($brand as $value){?>
                    <a href="<?php echo Url::to(['listpage/index','basebrand_id'=>$value['id']])?>"><?=$value['name']?></a>
                <?php }?>
                <!--<a href="#">雅诗兰黛</a><a class="hot" href="#">采诗精华</a><a href="#">耐克</a><a href="#">面膜</a><a class="hot" href="#">乳液</a><a href="#">百雀羚</a><a href="#">珀莱雅</a><a href="#">水秘密</a><a href="#">眉笔</a>-->
            </div>
        </div>
    </div>
</div>
<div class="g-navbar">
    <div class="wrapper">
        <div class="allsort">
            <h2><a href="#"><i></i>全部商品分类</a></h2>
            <div class="sortbox">
                <?php
                $i=0; 
                foreach ($cate as $k => $v) { ?>
                <dl class="<?php switch ($i){
                    case 0:
                        echo "hf";break;
                    case 1:
                        echo "cz";break;
                    case 2:
                        echo "xs";break;
                    case 3:
                        echo "mt";break;
                    case 4:
                        echo "mf";break;
                    case 5:
                        echo "ns";break;
                    case 6:
                        echo "bj";break;
                }
                $i++;
?>">
                        <dt><a href="<?php echo Url::to(['listpage/index', 'basetype_id' => $k]); ?>"><?php echo array_shift($v) ?></a></dt>
                        <dd>
                            <?php foreach ($v as $key => $val) { ?>
                                <a href="<?php echo Url::to(['listpage/index', 'basetype_id' => $key]); ?>"><?php echo $val; ?></a>
                            <?php } ?>
                        </dd>
                    </dl>
                <?php } ?>
                <!--					<dl class="hf">
                                                                <dt><a href="#">护肤</a></dt>
                                                                <dd>
                                                                        <a href="#">洁面</a><a href="#">卸妆</a><a href="#">乳液</a><a href="#">面霜</a><a href="#">喷雾</a><a href="#">精华</a><a href="#">眼部</a><a href="#">面膜</a><a href="#">防晒</a><a href="#">化妆水</a><a href="#">护理油</a><a href="#">化妆水</a>
                                                                </dd>
                                                        </dl>
                                                        <dl class="cz">
                                                                <dt><a href="#">彩妆</a></dt>
                                                                <dd>
                                                                        <a href="#">腮红</a><a href="#">唇膏</a><a href="#">粉底</a><a href="#">粉饼</a><a href="#">隔离</a><a href="#">遮瑕</a><a href="#">眼影</a><a href="#">眼线</a><a href="#">眉笔</a><a href="#">高光</a><a href="#">BB霜</a><a href="#">睫毛膏</a>
                                                                </dd>
                                                        </dl>
                                                        <dl class="xs">
                                                                <dt><a href="#">香水</a></dt>
                                                                <dd>
                                                                        <a href="#">女士</a><a href="#">男士</a><a href="#">中性</a><a href="#">香薰</a><a href="#">香膏</a>
                                                                </dd>
                                                        </dl>
                                                        <dl class="qt">
                                                                <dt><a href="#">其他</a></dt>
                                                                <dd>
                                                                        <a href="#">套装</a><a href="#">洗发</a><a href="#">护法</a><a href="#">造型</a><a href="#">染发</a><a href="#">头部</a><a href="#">身体</a><a href="#">颈部</a><a href="#">手部</a><a href="#">足部</a><a href="#">沐浴</a><a href="#">脱毛</a><a href="#">私密</a>
                                                                </dd>
                                                        </dl>-->
            </div>
        </div>
        <ul class="navlist">
            <li><a href="/">首页</a></li>
            <li><a href="<?php echo Url::to(['listqg/index']) ?>">我要供货</a></li>
            <li><a href="<?php echo Url::to(['listhy/index']) ?>">我要采购</a></li>
        </ul>
        <div class="minicart">
            <i class="icon"></i>
            <a class="quantity" href="<?=  Url::to(['cart/my-cart'])?>">
                <span>购物车</span><em id="cart_count"><?=  Cart::CountCart();?></em>
            </a>
        </div>
    </div>
</div>


